package com.pearl.mybatis.demo.map;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * @author TangDan
 * @version 1.0
 * @since 2023/5/6
 */

@Mapper(componentModel = "spring")
public interface CarMapper {

    /**
     * 实际映射方法期望源对象作为参数并返回目标对象。
     *
     * @param car 需要转换的对象
     * @return CarDto 转换后的对象
     */
    // @Mapping 标注映射关系
    @Mapping(source = "numberOfSeats", target = "seatCount")
    CarDTO carToCarDto(Car car);
}